package com.yqy.spring.service;

public class OrderServiceImpl implements OrderService{
    @Override
    public void generate() {
        try {
            Thread.sleep(1234);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单已生成");
    }

    @Override
    public void detail() {
        try {
            Thread.sleep(2541);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单信息如下：******");
    }

    @Override
    public void modify() {
        try {
            Thread.sleep(1010);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("订单已修改");
    }

    public static class Client {
        /**
         public static void main(String[] args) {
         OrderService orderServiceImplSub=new OrderServiceImplSub();
            orderServiceImplSub.detail();
            orderServiceImplSub.generate();
            orderServiceImplSub.modify();
        }
         */
        public static void main(String[] args) {
            OrderService target=new OrderServiceImpl();
            OrderServiceStaticProxy orderServiceStaticProxy=new OrderServiceStaticProxy(target);
            orderServiceStaticProxy.detail();
            orderServiceStaticProxy.modify();
            orderServiceStaticProxy.generate();
        }
    }
}
